#ifndef COOKIEHELPER_H
#define COOKIEHELPER_H

#include <string>
#include "CommonHdr.h"
#include "Log.h"

class CookieHelper
{
public:
	static wchar_t* GetAllCookies(const std::wstring &url);

	static wchar_t* GetCookies(const std::wstring &url,size_t *cookieLength);

	static wchar_t* GetProtectModeAllCookies(const std::wstring &url,size_t *cookieLength);

private:
	typedef HRESULT (WINAPI *PIEGetProtectedModeCookie)(LPCWSTR lpszURL,LPCWSTR lpszCookieName,LPWSTR pszCookieData,DWORD *pcchCookieData,DWORD dwFlags);

	static PIEGetProtectedModeCookie InitFunc();

	static PIEGetProtectedModeCookie pGetCookieFunc;

	static unsigned int initLock;

	static log4cplus::Logger log;
};

#endif